<template>
  <div class="hello">
    <button @click="doit">{{msg}}</button>
  </div>
</template>

<script>
export default {
  name: "HelloWorld",
  data(){
    return{
      token:'hahahha'
    }
  },
  props: {
    msg: String
  },
  methods: {
    doit() {
      console.log("hahahah ");
        this.$axios({
          method:'post',
          url:'/api/v5/iot/090c7d1e8400f3412fb8c01393027f79/devices/760f767a-065a-4afb-94c2-d6ce6c77cba4/commands',
          headers: {
           'X-Auth-Token':this.token,
           'Content-Type':'application/json'
          },
              data: {
                    "command_name": "YUNTAI_S",
                    "paras": {
                        "yuntai_s": 38
                    },
                    "service_id": "yuntai"
                }

        }).then(res=>{
		        console.log(res);
	      }).catch(err=>{
            console.log(err);    
        })
    }
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
</style>
